home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_bab_introscene.cog < prev    next >
Text File  |  1999-11-15  |  7KB  |  225 lines

  1. # Jones 3D Cog Script
  2. #
  3. # BAB_introsceme.cog
  4. #
  5. # [SXC & revised by HB]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ==============================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     user0
  14.    
  15.     thing       player                              local
  16.     thing       indyactor
  17.     
  18.     thing       actor_sight0                        nolink
  19.     thing       actor_sight1                        nolink
  20.     thing        intro_in_mk_1
  21.     thing        intro_in_mk_2
  22.     thing        intro_in_mk_3
  23.    
  24.     thing       cam0                                nolink
  25.     thing       cam1                                nolink
  26.     thing        cam2                                nolink
  27.     thing        cam0_tgt0                            nolink
  28.     thing       cam1_tgt0                            nolink
  29.     thing        cam2_tgt0                            nolink
  30.     
  31.     thing       fadeplane                            nolink
  32.     
  33.      keyframe    in_falling=in_jump_fall.key            local //159x
  34.     keyframe    in_landhard=in_jump_land_hard.key    local //57x
  35.     keyframe    in_handsONhips=0in_stand4.key       local
  36.     keyframe    in_sideTOhips=0in_stand1_bd_4.key   local
  37.     keyframe    in_hipsTOside=0in_stand4_bd_1.key   local
  38.     keyframe    in_ltarmup=0in_leftarm_1_1.key        local
  39.     keyframe    in_thinking=0in_thinking_4_4.key    local //150x
  40.  
  41.     material    topMat=pyr_jeep_top.mat                local
  42.     material    botMat=pyr_jeep_bbmp.mat            local
  43.     
  44.     sound       indyline0=inxj006.wav               local //0.8 sec
  45.     sound       indyline1=bb01j01.wav               local //6.8 sec
  46.     sound       jeep_run=jep_reverse_loop.wav       local
  47.     sound       jeep_stop=jep_engine_off.wav        local
  48.     sound       theme=mus_bab_intro.WAV             local
  49.     sound       indy_bodyfall=fol_in_landearth.wav  local
  50.  
  51.     flex        in_headRate                            local
  52.     flex        in_rotRate                            local
  53.     
  54.     int         checkit=0                           local
  55.     int         themechan=0                         local
  56.     int         jeepchan=0                          local
  57.     int            cursound                            local
  58.     int            in_track0                            local
  59.     int            in_track1                            local
  60.  
  61.     int            bSeen=0                                local
  62.     
  63. end
  64.  
  65. # ==============================================================================
  66.  
  67. code
  68.  
  69. startup:
  70.     
  71.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  72.  
  73.     Sleep(0.001); # Let engine get set up
  74.  
  75.     SetThingAlpha(fadeplane, 1.0); #make sure it's opaque
  76.     
  77.     # Start on black ...
  78.     SetCameraLookInterp(2, 0); #no pan, no tilt
  79.     SetCameraPosInterp(2, 0); #no dolly
  80.     SetCameraFocus(2, cam0);
  81.     SetCameraSecondaryFocus(2, indyactor);
  82.     SetCurrentCamera(2);
  83.     SetCameraFOV(55, 0, 0.0);
  84.  
  85.     return;
  86.  
  87. # ..............................................................................
  88.  
  89. user0: # RT: Indicates that autosave/restore has completed...
  90.  
  91.     if (bSeen) return; # RT
  92.     bSeen = 1;
  93.  
  94.     # fadein ...
  95.     SetCameraLookInterp(2, 0); //no pan, no tilt
  96.     SetCameraPosInterp(2, 0); //no dolly
  97.     SetCameraFocus(2, cam0);
  98.     SetCameraSecondaryFocus(2, indyactor);
  99.     SetCurrentCamera(2);
  100.     SetCameraFOV(55, 0, 0.0);
  101.     ThingFadeAnim(fadeplane, 1.0, 0.0, 1.0, 0);
  102.  
  103.      # RT: Set up jeep materials
  104.     SetMaterialCel(topMat, 1);
  105.     SetMaterialCel(botMat, 1);
  106.     
  107.     player = GetLocalPlayerThing();
  108.     SetThingAlpha(player, 1.0);
  109.     StartCutscene(1);
  110.     SetActorFlags(player, 0x200000);
  111.     
  112.     //fadein ...
  113.     SetCameraLookInterp(2, 0); //no pan, no tilt
  114.     SetCameraPosInterp(2, 0); //no dolly
  115.     SetCameraFocus(2, cam0);
  116.     SetCameraSecondaryFocus(2, indyactor);
  117.     SetCurrentCamera(2);
  118.     SetCameraFOV(55, 0, 0.0);
  119.     ThingFadeAnim(fadeplane, 1.0, 0.0, 1.0, 0);
  120.      
  121.     //StopSound(0, 0.0); //TEMP FOR TESTING!
  122.     //StopSound(1, 0.0); //TEMP FOR TESTING!
  123.     
  124.     themechan=PlaySoundLocal(theme, 1, 0, 0x0, 0);
  125.        
  126.     //Start the scene...
  127.     CopyPlayerHolsters(player, indyactor);
  128.     SetThingFlags(player, 0x80000);
  129.     ClearThingFlags(indyactor, 0x80000);
  130.     
  131.     //Prep actor and move him to 1st mark...
  132.     AISetCutsceneMode(indyactor);
  133.     AISetMoveSpeed(indyactor, 1.0);
  134.     in_headRate = GetThingMaxHeadVel(player);
  135.     SetThingMaxHeadVel(indyactor, 200.0);
  136.     in_rotRate = GetThingMaxRotVel(player);
  137.     SetThingMaxRotVel(indyactor, 200.0);
  138.     AISetMoveThing(indyactor, intro_in_mk_1, 0);
  139.     Sleep(0.01);
  140.     SetCameraFOV(45, 1, 2.0);
  141.     Sleep(0.5);
  142.     AISetLookThing(indyactor, actor_sight1);
  143.     AIWaitForStop(indyactor);
  144.     DestroyThing(fadeplane);
  145.  
  146.     //Indy drops down slope...
  147.     in_track0 = PlayKey(indyactor, in_falling, 6, 0x00, 0);
  148.     in_track1 = MoveThingToPos(indyactor, GetThingPos(intro_in_mk_2), 0.7);
  149.     ClearThingFlags(indyactor, 0x4000); //shadow off
  150.  
  151.     WaitForAnimStop(in_track1);
  152.     SetThingFlags(indyactor, 0x4000); //shadow on
  153.     StopKey(indyactor, in_track0, 0.0);
  154.     PlayKey(indyactor, in_landhard, 4, 0x12, 0); //ouch
  155.     PlaySoundThing(indy_bodyfall, indyactor, 1, 10, 20, 0); # TOO HEAVY! 
  156.     Sleep(0.7);
  157.  
  158.     //Cut to shot of Indy at bottom while he stands...
  159.     SetCameraFocus(2, cam1);
  160.     SetCameraSecondaryFocus(2, cam1_tgt0);
  161.     SetCameraFOV(90, 0, 0.0);
  162.     Sleep(0.01);
  163.     SetCameraFOV(70, 1, 3.0);
  164.     Sleep(1.2); //until Indy is standing up again
  165.     AISetLookThing(indyactor, actor_sight1);
  166.       
  167.     //Start Indy toward 3rd mark...
  168.     AISetMoveThing(indyactor, intro_in_mk_3, 0);
  169.     Sleep(1.8);
  170.  
  171.     //Cut to reverse...
  172.     SetCameraFocus(2, cam2);
  173.     SetCameraSecondaryFocus(2, cam2_tgt0);
  174.     SetCameraFOV(70, 0, 0.0);
  175.     Sleep(0.01);
  176.     SetCameraFOV(90, 1, 0.5);
  177.     AIWaitForStop(indyactor);
  178.  
  179.     //play keys and voice files
  180.  
  181.     //StopSound(0, 0.0); //TEMP FOR TESTING!
  182.     //StopSound(1, 0.0); //TEMP FOR TESTING!
  183.     
  184.     //Indy: "wheeeooo"
  185.     cursound = PlayVoice(indyactor, indyline0, 1, 1);   
  186.     WaitForSound(cursound);
  187.     
  188.     //Indy: "Babylon...mud brick...why Russians dig up?"
  189.     cursound = PlayVoice(indyactor, indyline1, 1, 0);
  190.     Sleep(0.5);
  191.      PlayKey(indyactor, in_ltarmup, 4, 0x12, 1);
  192.        in_track0 = PlayKey(indyactor, in_handsONhips, 2, 0x00, 0);
  193.     PlayKey(indyactor, in_sideTOhips, 4, 0x12, 1);
  194.     in_track1 = PlayKey(indyactor, in_thinking, 4, 0x12, 0);
  195.     Sleep(4.0);
  196.     StopKey(indyactor, in_track0, 0.5);
  197.     StopKey(indyactor, in_track1, 0.5);
  198.     Sleep(0.5);
  199.  
  200.     WaitForSound(cursound);
  201.    
  202.     //Restore Everything
  203.     CopyOrientAndPos(indyactor, player);
  204.     ResetCameraFOV(0, 0.0);
  205.     SetCameraLookInterp(2, 0);
  206.     SetCameraPosInterp(2, 0);
  207.     SetCameraInterpSpeed(2, 0);
  208.     Sleep(0.01);
  209.     SetCameraPosition(1, GetThingPos(cam2));
  210.     ClearThingFlags(player, 0x80000);
  211.     SetThingMaxHeadVel(indyactor, in_headRate);
  212.     SetThingMaxRotVel(indyactor, in_rotRate);
  213.     SetThingFlags(indyactor, 0x80000);
  214.     SetCurrentCamera(1);
  215.  
  216.     //Give player gear...
  217.     SetInv(player, 82, 1); 
  218.     SetInvAvailable(player, 82, 1);
  219.  
  220.     EndCutscene();
  221.     ClearActorFlags(player, 0x200000);
  222.         
  223.     return;
  224.         
  225. end